@echo off
echo.
echo  #     #                       #####               #######                     
echo  #     #   ##    ####  #    # #     # #   #  ####     #    ######   ##   #    #
echo  #     #  #  #  #    # #   #  #        # #  #         #    #       #  #  ##  ##
echo  ####### #    # #      ####    #####    #    ####     #    #####  #    # # ## #
echo  #     # ###### #      #  #         #   #        #    #    #      ###### #    #
echo  #     # #    # #    # #   #  #     #   #   #    #    #    #      #    # #    #
echo  #     # #    #  ####  #    #  #####    #    ####     #    ###### #    # #    #
echo.
echo              HackSys Extreme Vulnerable Driver Exploit Build Utility

REM store the current directory path
set currentDir=%cd%

REM store the local symbol server path
set localSymbolServerPath=C:\Xtra\Symbols\Custom\

set VC_PATH="%VS100COMNTOOLS%\..\..\VC\vcvarsall.bat"

echo.
echo **************************************************
@call %VC_PATH% x86
echo **************************************************

cd %currentDir%\..\Exploit

echo.
echo **************************************************
echo Building HackSys Extreme Vulnerable Driver Exploit
echo **************************************************
echo.
rmdir /S /Q %currentDir%\..\compile\exploit
msbuild /t:Clean;Build /p:OutDir=%currentDir%\..\compile\exploit\;Configuration=Release;Platform=Win32
echo **************************************************
echo.
echo **************************************************
echo Cleaning The Build Directory
echo **************************************************
echo.
echo Deleting Release folder
rmdir /S /Q %currentDir%\..\Exploit\Release
echo ******************************************

echo.
echo ******************************************
echo Transferring Driver Symbols to Symbol Store
echo ******************************************
cd "C:\Program Files\Debugging Tools for Windows (x86)"
echo.
symstore.exe add /r /f %currentDir%\..\compile\exploit\ /s %localSymbolServerPath% /t "ExploitSymbol" /v "1.0"
echo ******************************************
echo.
echo ******************************************
echo HackSys Extreme Vulnerable Driver Built
echo              Successfully
echo ******************************************
echo.
cd %currentDir%
pause
